import { type DefaultTheme } from 'vitepress'

interface Sidebar {
    base: string
    items: DefaultTheme.SidebarItem[]
}

interface Menu {
    nav: DefaultTheme.NavItemWithLink,
    sidebar: Sidebar
}

const menu: Record<string, Menu> = {
    guide: {
        nav: {
            text: 'blog',
            activeMatch: '/guide/',
            link: '/guide/front'
        },
        sidebar: {
            base: '/guide/',
            items: [
                { text: '前端', link: 'front' },
                { text: '后端', link: 'back' },
                { text: '工具', link: 'tools' },
                { text: '收录', link: 'collect' },
                { text: '算法', link: 'algorithm' },
            ]
        }
    },
    // 语言
    html: {
        nav: {
            text: 'html',
            activeMatch: '/front/language/html/',
            link: '/front/language/html/guide'
        },
        sidebar: {
            base: '/front/language/html/',
            items: [
                { text: '引言', link: 'guide' },
                { text: '常见问题', link: 'questions' }, {
                    text: '概念',
                    base: '/front/language/html/concept/',
                    items: [
                        { text: '认识html', link: 'structure' },
                        { text: '基础概念', link: 'basic' },
                        { text: '页面配置', link: 'meta' },
                        { text: '全局属性', link: 'global' },
                        { text: '特殊字符', link: 'special' },
                    ]
                }, {
                    text: '标签',
                    base: '/front/language/html/tags/',
                    items: [
                        { text: '排版类', link: 'compose' },
                        { text: '文本类', link: 'text' },
                        { text: '超链接', link: 'hyperlink' },
                        { text: '列表', link: 'list' },
                        { text: '表单', link: 'form' },
                        { text: '表格', link: 'table' },
                        { text: '图形类', link: 'image' },
                        { text: '多媒体', link: 'media' },
                    ]
                }
            ]
        }
    },

    // 样式
    css: {
        nav: {
            text: 'css',
            activeMatch: '/front/style/css/',
            link: '/front/style/css/guide' 
        },
        sidebar: {
            base: '/front/style/css/',
            items: [
                { text: '引言', link: 'guide' },
                { text: '常见问题', link: 'questions' },
                { text: '技巧运用', link: 'example' }, {
                    text: '概念',
                    base: '/front/style/css/concept/',
                    items: [
                        { text: '基础', link: 'basic' },
                        { text: '常用属性', link: 'property' },
                        { text: '选择器', link: 'selector' },
                        { text: '盒子模型', link: 'box' },
                        { text: '布局属性', link: 'layout0' },
                        { text: '常见布局', link: 'layout1' },
                        { text: '特效属性', link: 'effects' },
                        // { text: '场景运用', link: 'example' },
                        { text: '移动端', link: 'mobile' },
                        // { text: '其他', link: 'other' },
                    ]
                }, {
                    text: '拓展',
                    base: '/front/style/css/',
                    items: [
                        { text: 'sass', link: 'sass' },
                        { text: 'unocss', link: 'unocss' },
                    ]
                }
            ]
        }
    },

    javaScript: {
        nav: {
            text: 'javaScript',
            activeMatch: '/front/language/javaScript/',
            link: '/front/language/javaScript/guide'
        },
        sidebar: {
            base: '/front/language/javaScript/',
            items: [
                { text: '引言', link: 'guide' },
                { text: '常见问题', link: 'questions' }, {
                    text: 'ECMAScript',
                    base: '/front/language/javaScript/es/',
                    items: [
                        { text: '变量定义', link: 'variable' },
                        { text: '数据类型', link: 'dataType' },
                        { text: '函数运用', link: 'function' },
                        { text: '异步编程', link: 'async' },
                        { text: '核心机制', link: 'framework' },
                        { text: '正则表达式', link: 'regex' },
                        { text: '模块化规范', link: 'module' },
                        { text: 'ECMAScript特性', link: 'es' },
                    ]
                }, {
                    text: 'DOM',
                    base: '/front/language/javaScript/dom/',
                    items: [
                        { text: '元素', link: 'element' },
                        { text: '事件', link: 'event' },
                        { text: '事件流', link: 'eventflow' },
                    ]
                }, {
                    text: 'BOM',
                    base: '/front/language/javaScript/bom/',
                    items: [
                        { text: 'window对象', link: 'window' },
                        { text: '本地存储', link: 'localstore' },
                    ]
                }
            ]
        }
    },
    typeScript: {
        nav: {
            text: 'typeScript',
            activeMatch: '/front/language/typeScript/',
            link: '/front/language/typeScript/guide'
        },
        sidebar: {
            base: '/front/language/typeScript/',
            items: [{
                text: 'typeScript',
                items: [
                    { text: '引言', link: 'guide' },
                    { text: '数据类型', link: 'dataType' },
                    { text: '函数', link: 'function' },
                    { text: '编译', link: 'build' },
                    { text: '常见问题', link: 'questions' },
                ]
            }]
        }
    },

    'nodejs': {
        nav: {
            text: 'node.js',
            activeMatch: '/front/style/sass/',
            link: '/front/style/sass/guide'
        },
        sidebar: {
            base: '/front/style/sass/',
            items: [{
                text: 'sass',
                items: [
                    { text: '引言', link: 'guide' },
                    { text: 'sass', link: 'sass' },
                ]
            }]
        }
    },

    // 框架
    vue: {
        nav: {
            text: 'vue',
            activeMatch: '/front/framework/vue/',
            link: '/front/framework/vue/guide'
        },
        sidebar: {
            base: '/front/framework/vue/',
            items: [{
                text: 'vue',
                items: [
                    { text: '引言', link: 'guide' },
                    { text: '基础', link: 'basic' },
                    { text: '响应式', link: 'reactivity' },
                    { text: '生命周期', link: 'lifecycle' },
                    { text: '选项式', link: 'options' },
                    { text: '组合式', link: 'composition' },
                    { text: '深入组件', link: 'component' },
                    { text: '指令', link: 'directives' },
                    { text: '路由', link: 'router' },
                    { text: '状态管理', link: 'state' },
                ]
            }]
        }
    },
    sass: {
        nav: {
            text: 'sass',
            activeMatch: '/front/style/sass/',
            link: '/front/style/sass/guide'
        },
        sidebar: {
            base: '/front/style/sass/',
            items: [{
                text: 'sass',
                items: [
                    { text: '引言', link: 'guide' },
                    { text: 'sass', link: 'sass' },
                ]
            }]
        }
    },
    unocss: {
        nav: {
            text: 'unocss',
            activeMatch: '/front/style/unocss/',
            link: '/front/style/unocss/guide'
        },
        sidebar: {
            base: '/front/style/unocss/',
            items: [{
                text: 'unocss',
                items: [
                    { text: '引言', link: 'guide' },
                    { text: 'unocss', link: 'unocss' },
                ]
            }]
        }
    },

    framework: {
        nav: {
            text: '框架',
            activeMatch: '/front/framework/',
            link: '/front/framework/vitepress'
        },
        sidebar: {
            base: '/front/framework/',
            items: [
                { text: 'vitepress', link: 'vitepress' },
                { text: 'monorepo', link: 'monorepo' },
                { text: 'microApp', link: 'microApp' },
                { text: 'qiankun', link: 'qiankun' },
                { text: 'uniapp', link: 'uniapp' },
            ]
        }
    },

    // 标准规范
    standard: {
        nav: {
            text: '规范',
            activeMatch: '/front/standard/',
            link: '/front/standard/guide'
        },
        sidebar: {
            base: '/front/standard/',
            items: [
                { text: '规范', link: 'guide' },
                { text: 'ESlint', link: 'eslint' },
            ]
        }
    },

    // 环境构建
    build: {
        nav: {
            text: '编译构建',
            activeMatch: '/front/build/',
            link: '/front/build/guide'
        },
        sidebar: {
            base: '/front/build/',
            items: [
                { text: '引言', link: 'guide' },
                { text: 'node', link: 'node' },
                { text: 'npm', link: 'npm' },
                { text: 'pnpm', link: 'pnpm' },
                { text: 'webpack', link: 'webpack' },
                { text: 'vite', link: 'vite' },
                { text: 'rollup', link: 'rollup' },
                { text: 'glup', link: 'glup' },
                { text: 'nginx', link: 'nginx' },
            ]
        }
    },

    // 依赖库
    dependence: {
        nav: {
            text: '依赖库',
            activeMatch: '/front/dependence/',
            link: '/front/dependence/guide'
        },
        sidebar: {
            base: '/front/dependence/',
            items: [
                { text: '引言', link: 'guide' },
                {
                    text: '组件库',
                    base: '/front/dependence/components/',
                    items: [
                        { text: 'ECharts', link: 'echarts' },
                        { text: 'elementUI', link: 'elementUI' },
                        { text: 'elementPlus', link: 'elementPlus' },
                        { text: 'vxeTable', link: 'vxeTable' },
                    ]
                },
                {
                    text: '常用库',
                    base: '/front/dependence/api/',
                    items: [
                        { text: 'moment', link: 'moment' },
                        { text: 'day.js', link: 'dayjs' },
                        { text: 'axios', link: 'axios' },
                        { text: 'fastglob', link: 'fastglob' },
                    ]
                }]
        }
    },

    // 专题
    special: {
        nav: {
            text: '专题研讨',
            activeMatch: '/front/special/',
            link: '/front/special/guide'
        },
        sidebar: {
            base: '/front/special/',
            items: [
                { text: '引言', link: 'guide' },
                { text: '日期时间', link: 'datetime' },
                { text: 'Browser', link: 'browser' },
                { text: '地图', link: 'map' },
                { text: '问题汇总', link: 'questions' },
            ]
        }
    },

    back: {
        nav: {
            text: 'back',
            activeMatch: '/back/',
            link: '/back/docker'
        },
        sidebar: {
            base: '/back/',
            items: [
                {
                    text: 'java体系',
                    collapsed: false,
                    base: '/back/java/',
                    items: [
                        { text: 'java', link: 'java' },
                        { text: 'spring', link: 'spring' },
                        { text: 'maven', link: 'maven' },
                    ]
                },
                {
                    text: '数据库',
                    collapsed: false,
                    base: '/back/database/',
                    items: [
                        { text: 'MySql', link: 'mysql' },
                    ]
                },
            ]
        }
    },

    // devops
    devops: {
        nav: {
            text: 'devops',
            activeMatch: '/devops/',
            link: '/devops/docker'
        },
        sidebar: {
            base: '/devops/',
            items: [
                { text: 'docker', link: 'docker' },
                { text: 'Jenkins', link: 'Jenkins' },
                { text: 'svn', link: 'svn' },
                { text: 'git', link: 'git' },
            ]
        }
    },

    tools: {
        nav: {
            text: '工具',
            activeMatch: '/tools/',
            link: '/tools/docker'
        },
        sidebar: {
            base: '/tools/',
            items: [
                {
                    text: '常用工具',
                    collapsed: false,
                    base: '/tools/common/',
                    items: [
                        { text: 'Everything', link: 'everything' },
                        { text: 'Sinpaste', link: 'sinpaste' },
                        { text: 'Typora', link: 'typora' },
                        { text: 'compare', link: 'compare' },
                        { text: 'Zoomit', link: 'zoomit' },
                        { text: 'OVOclound', link: 'ovoclound' },
                        { text: 'LICEcap', link: 'licecap' },
                    ]
                },
                {
                    text: '开发工具',
                    collapsed: false,
                    base: '/tools/develop/',
                    items: [
                        { text: 'vscode', link: 'vscode' },
                        { text: 'Intellij idea', link: 'intellijIdea' },
                        { text: 'Navicate', link: 'navicate' },
                        { text: 'FlashFXP', link: 'FlashFXP' },
                        { text: 'Xshell', link: 'Xshell' },
                        { text: 'HBuilderX', link: 'HBuilderX' },
                    ]
                },
                {
                    text: '设计工具',
                    collapsed: false,
                    base: '/tools/design/',
                    items: [
                        { text: 'Axure', link: 'Axure' },
                    ]
                },
            ]
        }
    },

    platform: {
        nav: {
            text: '平台',
            activeMatch: '/platform/',
            link: '/platform/docker'
        },
        sidebar: {
            base: '/platform/',
            items: [
                { text: 'linux', link: 'linux' },
                { text: 'windows', link: 'windows' },
            ]
        }
    }
}


export default menu